package com.ssy.lingxi.settle.accounts.entity;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;

/**
 * 会员结算策略
 * @author 伍将
 * @date 2020/10/21
 * @version 2.0.0
 */
@Entity
@Table(schema = "public", name = "sa_member_settlement_strategy",
        indexes = {@Index(name = "sa_member_settlement_strategy_member_id_idx", columnList = "memberId"),
                @Index(name = "sa_member_settlement_strategy_role_id_idx", columnList = "roleId"),
                @Index(name = "sa_member_settlement_strategy_settlement_way_idx", columnList = "settlementWay"),
                @Index(name = "sa_member_settlement_strategy_settlement_order_type_idx", columnList = "settlementOrderType"),
                @Index(name = "sa_member_settlement_strategy_status_idx", columnList = "status")})
public class MemberSettlementStrategyDO implements Serializable {
    private static final long serialVersionUID = 4793381110391318224L;

    /**
     * ID
     */
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "member_settlement_strategy_seq")
    @SequenceGenerator(sequenceName = "sa_member_settlement_strategy_seq", name = "member_settlement_strategy_seq", allocationSize = 1)
    private Long id;

    /**
     * 策略名称
     */
    @Column(columnDefinition = "varchar(48)")
    private String name;

    /**
     * 结算方式:1.账期（默认） 2.月结
     */
    @Column(columnDefinition = "int")
    private Integer settlementWay = 1;

    /**
     * 账期天数
     */
    @Column(columnDefinition = "int")
    private Integer settlementDays;

    /**
     * 结算日期
     */
    @Column(columnDefinition = "int")
    private Integer settlementDate;

    /**
     * 付款日
     */
    @Column(columnDefinition = "int")
    private Integer estimatedPaymentDate;

    /**
     * 结算单据类型:SettlementOrderTypeEnum
     * 1.生成通知单 2.物流单 3.订单 4.积分订单 5.退货申请单
     */
    @Column(columnDefinition = "int")
    private Integer settlementOrderType;

    /**
     * 结算支付方式:SettlementTypeEnum
     * 1.线下结算 2.通联支付结算
     */
    @Column(columnDefinition = "int")
    private Integer settlementPaymentType;

    /**
     * 会员id
     */
    @Column(columnDefinition = "int8")
    private Long memberId;

    /**
     * 角色id
     */
    @Column(columnDefinition = "int8")
    private Long roleId;

    /**
     * 是否有效：0.否 1.是
     */
    @Column(columnDefinition = "int")
    private Integer status;

    /**
     * 创建时间
     */
    @Column(columnDefinition = "int8")
    private Long createTime;

    /**
     * 更新时间
     */
    @Column(columnDefinition = "int8")
    private Long updateTime;

    /**
     * 成员列表
     */
    @OneToMany(mappedBy = "strategy", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
    private List<MemberSettlementStrategyMemberDO> memberList;

    public List<MemberSettlementStrategyMemberDO> getMemberList() {
        return memberList;
    }

    public void setMemberList(List<MemberSettlementStrategyMemberDO> memberList) {
        this.memberList = memberList;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getSettlementWay() {
        return settlementWay;
    }

    public void setSettlementWay(Integer settlementWay) {
        this.settlementWay = settlementWay;
    }

    public Integer getSettlementDays() {
        return settlementDays;
    }

    public void setSettlementDays(Integer settlementDays) {
        this.settlementDays = settlementDays;
    }

    public Integer getSettlementDate() {
        return settlementDate;
    }

    public void setSettlementDate(Integer settlementDate) {
        this.settlementDate = settlementDate;
    }

    public Integer getEstimatedPaymentDate() {
        return estimatedPaymentDate;
    }

    public void setEstimatedPaymentDate(Integer estimatedPaymentDate) {
        this.estimatedPaymentDate = estimatedPaymentDate;
    }

    public Integer getSettlementOrderType() {
        return settlementOrderType;
    }

    public void setSettlementOrderType(Integer settlementOrderType) {
        this.settlementOrderType = settlementOrderType;
    }

    public Integer getSettlementPaymentType() {
        return settlementPaymentType;
    }

    public void setSettlementPaymentType(Integer settlementPaymentType) {
        this.settlementPaymentType = settlementPaymentType;
    }

    public Long getMemberId() {
        return memberId;
    }

    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    public Long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Long updateTime) {
        this.updateTime = updateTime;
    }
}
